package com.hicorp.segment.service;

import com.hicorp.segment.pojo.po.MaterialConcrete;
import com.hicorp.segment.pojo.po.OrderReceiptSubMaterial;
import com.hicorp.segment.pojo.po.Receipts;
import com.hicorp.segment.utils.ResultBean;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: wqs
 * @Date: Created in 17:51 2021/5/31
 * @Description:
 * @ChineseDescription:
 * @Modified_By:
 */
@Service
public interface ReceiptsService {
    // 查询所有
    ResultBean<List<Receipts>> queryInfo(String tableName);

    // 单据新增
    ResultBean<Integer> insert(Receipts record);

    // 单据修改
    ResultBean<Integer> update(Receipts record);

    // 批量删除
    ResultBean<Integer> batchDeleteRecord(String tableName, List<Long> ids);

    // 批量作废
    ResultBean<Integer> batchInvalidRecord(String tableName, List<Long> ids);

    // 按单个字段搜索
    Object selectRecords(String tableName, String fieldName, String fieldValue);

    // 组合搜索
    ResultBean<List<Receipts>> searchRecord(String tableName, Receipts receipts);

    // 提交审批
    ResultBean<Integer> submitApproveRecord(String tableName, String approveStatus, Receipts receipts);

    // 审批
    ResultBean<Integer> approveRecord(String tableName, String approveStatus, String remark, String user, String role, Receipts receipts);

    // 生成单据内部编码
    ResultBean<String> generateReceiptsNo(String tableName, String preNo);

    // 查询，通过表名和内部编码来获取主子表数据
    ResultBean<Receipts> selectByTableNameAndNo(String tableName, String no);

    // 远程搜索数据获取，通过表名
    ResultBean<List<MaterialConcrete>> selectAutocompleteInput(String tableName);

    // 通过no和itemNo来查找订单单据物料BOM表中的数据
    ResultBean<List<OrderReceiptSubMaterial>> selectOrderReceiptsSubMaterial(String tableName, String no, String itemNo);

    //子组件展开细节提交保存
    ResultBean<Integer> submitOrderMaterial(String tableName, ArrayList<OrderReceiptSubMaterial> orderReceiptSubMaterialList, String no, String itemNo);
}
